# 将字符串转换成二进制数据
bytes_arr = "今晚".encode(encoding="utf-8") # encoding="utf-8"

#b'\xe4\xbb\x8a\xe6\x99\x9a'  "utf-8"
#b'\xbd\xf1\xcd\xed'   "GBK"
print(bytes_arr,type(bytes_arr))
rst = bytes_arr.decode(encoding="utf-8")
print(rst)

print("----------------------------")
bytes_arr = "今晚".encode(encoding="GBK") # encoding="utf-8"

#b'\xe4\xbb\x8a\xe6\x99\x9a'  "utf-8"
#b'\xbd\xf1\xcd\xed'   "GBK"
print(bytes_arr,type(bytes_arr))
rst = bytes_arr.decode(encoding="GBK")
print(rst)
